package com.example.website.controller;

import com.example.website.bean.NewsInfor;
import com.example.website.service.NewsInforService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/pc")
public class PcController  extends BaseController {


    @Autowired
    public NewsInforService newsInforService;

    /**
     * 首页
     */
    @RequestMapping("/index")
    public ModelAndView index(ModelMap modelMap) {
        NewsInfor newsInfor = newsInforService.getSpareOne();
        modelMap.put("newsInfor",newsInfor);
        return new ModelAndView("index", modelMap);
    }

}
